<?php

namespace app\common\model;

use think\Model;

/**
 * 订单管理
 */
class Order Extends Model
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deleteTime';

    // 追加属性
    protected $append = [
    ];


    /*public function goods(){
        return $this->belongsTo('Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(1);
    }

    public function prizedraw(){
        return $this->hasMany('PrizeDraw', 'prize_id', 'id');
    }*/

    public function orderproducts(){
        return $this->belongsTo('OrderProducts', 'order_sn', 'order_sn', [], 'LEFT');
    }
}
